const data = [
    {
        id: 1,
        text: '节点1',
        parentId: 0,
        children: [
            {
                id: 2,
                text: '节点1_1',
                parentId: 1
            }
        ]
    }
]
let res = []
function Tree2List(data) {
    Array.from(data).forEach((item,index) => {
        const {id,text,parentId,children} = item
        res.push({id,text,parentId})
        if (children) {
            Tree2List(children)
        }
    })
    return res
}

console.log(Tree2List(data));
